﻿using System.Collections.Generic;
using System.Xml;

using Vibstudio.X4NET.Csv;

namespace Vibstudio.X4NET.Xml.Conversion
{
    public interface IXmlConversion
    {
        #region CSV -> XML

        #region Dynamic configuration algorithms

        OperationResult<XmlDocument> CsvToXml(string csvPath, string xsdPath, bool validate = true, bool omitXmlDeclaration = false);

        ConversionResult<string, XmlDocument> CsvToXml(string csvHeaderRow, string csvDataRow, string xsdPath, bool validate = true, bool omitXmlDeclaration = false);

        IEnumerable<ConversionResult<string, XmlDocument>> CsvToXml(string[] csvRows, string xsdPath, bool validate = true, bool omitXmlDeclaration = false);

        OperationResult<XmlDocument> CsvToXml(byte[] csvFile, string xsdPath, bool validate = true, bool omitXmlDeclaration = false);

        #endregion

        #region Parameters configuration algorithms

        OperationResult<XmlDocument> CsvToXml(string csvPath, CsvConversionConfig config, bool validate = true, bool omitXmlDeclaration = false);

        IEnumerable<ConversionResult<string, XmlDocument>> CsvToXml(string[] csvRows, CsvConversionConfig config, bool validate = true, bool omitXmlDeclaration = false);

        OperationResult<XmlDocument> CsvToXml(byte[] csvFile, CsvConversionConfig config, bool validate = true, bool omitXmlDeclaration = false);

        #endregion

        #endregion

        #region XML -> CSV

        #region Dynamic configuration algorithms

        ConversionResult<XmlDocument, CsvDocument> XmlToCsv(string xmlPath, string xsdPath);

        ConversionResult<XmlDocument, CsvDocument> XmlToCsv(byte[] xmlFile, string xsdPath);

        ConversionResult<XmlDocument, CsvDocument> XmlToCsv(XmlDocument document, string xsdPath);

        #endregion

        #region Parameters configuration algorithms

        ConversionResult<XmlDocument, CsvDocument> XmlToCsv(string xmlPath, CsvConversionConfig config);

        ConversionResult<XmlDocument, CsvDocument> XmlToCsv(byte[] xmlFile, CsvConversionConfig config);

        ConversionResult<XmlDocument, CsvDocument> XmlToCsv(XmlDocument document, CsvConversionConfig config);

        #endregion

        #endregion
    }
}
